local skel = fk.CreateSkill {
  name = "efengqi__paoxiao",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["efengqi__paoxiao"] = "咆哮",
  [":efengqi__paoxiao"] = "锁定技，若你使用的上一张牌是基本牌，你使用【杀】无距离和次数限制且造成的伤害+1。",
  ["@@efengqi__paoxiao"] = "咆哮!",
  ["#efengqi__paoxiao_delay"] = "咆哮",

  ["$efengqi__paoxiao1"] = "喝啊！",
  ["$efengqi__paoxiao2"] = "今，必斩汝马下！",
}

skel:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player:getMark("@@efengqi__paoxiao") ~= 0 and data.card.trueName == "slash"
  end,
  on_use = function(self, event, target, player, data)
    player.room:setPlayerMark(player, "@@efengqi__paoxiao", 0)
    data.additionalDamage = (data.additionalDamage or 0) + 1
    if not data.extraUse then
      player:addCardUseHistory(data.card.trueName, -1)
      data.extraUse = true
    end
  end,
})

skel:addEffect(fk.CardUseFinished, {
  can_refresh = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name)
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:setPlayerMark(player, "@@efengqi__paoxiao", data.card.type == Card.TypeBasic and 1 or 0)
  end,
})

skel:addEffect("targetmod", {
  bypass_times = function(self, player, skill)
    return player:hasSkill(skel.name) and skill.trueName == "slash_skill" and player:getMark("@@efengqi__paoxiao") > 0
  end,
  bypass_distances = function(self, player, skill)
    return player:hasSkill(skel.name) and skill.trueName == "slash_skill" and player:getMark("@@efengqi__paoxiao") > 0
  end,
})

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@@efengqi__paoxiao", 0)
end)

return skel
